<?php

class ErrorDefine
{
	const SYSTEM_ERROR						= 1000;
	const DATABASE_ERROR					= 1001;

	const ILLEGALL_URI						= 10000;
	const INVALID_TOKEN						= 10001;
	const SHORT_OF_MOBILE					= 10002;
	const INVALID_MOBILE					= 10003;
	const REQUEST_TOO_OFTEN				= 10004;
	const GET_VERIFY_CODE_FAILED	= 10005;
	const INVALID_VERIFY_CODE			= 10006;
	const EXPIERD_VERIFY_CODE     = 10007;
	const EMPTY_POST_DATA					= 10008;
	const DATA_DECODE_FAILED			= 10009;
	const SHORT_OF_UTYPE					= 10010;
	const INVALID_UTYPE						= 10011;
	const SHORT_OF_VERIFY_CODE		= 10012;
	const ILLEGAL_VERIFY_CODE			= 10013;
	const SHORT_OF_PASSWORD				= 10014;
	const ILLEGAL_PASSWORD				= 10015;
	const PASSWORD_TOO_SHORT			= 10016;
	const PASSWORD_TOO_LONG				= 10017;
	const MOBILE_EXISTS						= 10018;
	const ALLOC_USER_ID_FAILED		= 10019;
	const REGISTER_FAILED					= 10020;
	const INSERT_TABLE_FAILED			= 10021;
	const UPDATE_TABLE_FAILED     = 10022;
	const MOBILE_NOT_EXIST        = 10023;
	const PASSWORD_NOT_CORRECT		= 10024;
	const SHORT_OF_TOKEN					= 10025;
	const REQUIRED_FIELD_EMPTY		= 10026;
	const INCORRECT_FIELD_FORMAT	= 10027;
	const USER_NOT_EXIST					= 10028;
	const RESET_PASSWORD_FAILED		= 10029;
	const LOGIN_FAILED						= 10030;
	const LOGOUT_FAILED						= 10031;
	const MODIFY_PROFILE_FAILED		= 10032;
	const CHANGE_PASSWORD_FAILED	= 10033;
	const SHORT_OF_ADVERTISEMENT_ID	= 10034;
	const SHORT_OF_PARAMETER			= 10035;
	const COURSE_NOT_EXIST				= 10036;
	const SHORT_OF_VIDEO_ID				= 10037;
	const ILLEGAL_VIDEO_ID				= 10038;
	const VIDEO_NOT_EXIST					= 10039;
	const SELECT_TABLE_FAILED			= 10040;
	const SHORT_OF_MARK						= 10041;
	const INVALID_MARK						= 10042;
	const SHORT_OF_COURSE_ID			= 10043;
	const ILLEGAL_COURSE_ID				= 10044;
	const SHORT_OF_EXPERT_ID			= 10045;
	const ILLEGAL_EXPERT_ID				= 10046;
	const EXPERT_NOT_EXIST				= 10047;
	const SHORT_OF_TEST_ID				= 10048;
	const ILLEGAL_TEST_ID					= 10049;
	const TEST_NOT_EXIST					= 10050;
	const SHORT_OF_RIGHT_NUM			= 10051;
	const ILLEGAL_RIGHT_NUM				= 10052;
	const SHORT_OF_ANSWERS				= 10053;
	const ILLEGAL_ANSWERS					= 10054;
	const IVLALID_TIME_FORMAT			= 10055;
	const SHORT_OF_MESSAGE				= 10056;
	const EMPTY_MESSAGE						= 10057;
	const SHORT_OF_TO_UID					= 10058;
	const INVALID_USER_ID					= 10059;
	const SEND_MESSAGE_FAILED			= 10060;
	const INVALID_MTYPE						= 10061;
	const SHORT_OF_MESSAGE_ID			= 10062;
	const SHORT_OF_NOTICE_ID			= 10063;
	const INVALID_NOTICE_ID				= 10064;

	const INVALID_REG_CODE				= 10065;
	const GRANT_CONPONS_FAILED		= 10066;
	const NO_REG_CODE				    	= 10067;
	const INVALID_MONEY                 = 10068;
	const INVALID_PAY_CHANNEL           = 10069;
	const CLOSE_PAY_CHANNEL             = 10070;
	const CHARGE_ORDER_FAILED			= 10071;

	const INVALID_ORDER_NO              = 10072;
	const ERROR_ORDER_STATUS            = 10073;
	const CANCEL_ORDER_FAILED           = 10074;
	const INVALID_LIVE_COURSE_ID        = 10075;
	const LIVE_COURSE_ORDER_FAILED      = 10076;
	const INVALID_PAY_TYPE              = 10077;
	const INVALID_PAY_BALANCE           = 10078;
	const INVALID_COUPON_ID             = 10079;
	const LESS_BALANCE                  = 10080;
	const INVALID_BUSINESS_TYPE         = 10081;
	const INVALID_ORDER                 = 10082;
	const ALIPAY_SIGN_FAILED            = 10083;
	const ALIPAY_VERIFY_NOTIFY_SIGN_FAILED      = 10084;

	const LIVE_COURSE_NOT_EXIST		= 10085;
	const SHORT_OF_LIVE_COURSE_ID	= 10086;

	const SHORT_OF_PORTRAIT_DATA	= 10087;
	
	const SHORT_OF_SUBJECT          = 10088;
	
	const WXPAY_SIGN_FAILED         = 10089;
	const WXPAY_REQUEST_FAILED      = 10090;
	const WXPAY_VETIFY_SIGN_FAILED  = 10091;
	const WXPAY_NOTIFY_SHORT_PARA   = 10092;
	const WXPAY_NOTIFY_FAILD        = 10093;
	const WXPAY_FAILED              = 10094;
	const ALIPAY_FAILED             = 10095;
	const COURSE_BUYED              = 10096;
	const COURSE_ORDER_CREATED      = 10097;
	const COURSE_ENDED              = 10098;
	const GET_COURSES_FAILED        = 10099;
	const COURSE_EMPTY              = 10100;
	const SHORT_OF_CATALOG_ID       = 10101;
	const NO_LESSONS                = 10102;
	const SHORT_OF_EXPERT_TYPE      = 10103;
	const INVALID_LESSON_ID         = 10104;
	const SHORT_OF_STAGE_TYPE       = 10105;
	const SHORT_OF_SUBJECT_ID       = 10106;
	const SHORT_OF_CCVID            = 10107;
	const INVALID_PARTNER_ID        = 10108;
	const CHARGE_ORDER_NOT_EXIT		= 10109;
	const MOVE_COURSE_LOSE 			= 10110;

	const SHORT_OF_STAGE 			= 10111;

	const INVALID_BIRTH				= 10112;
	const MARK_LESSON_FAILED		= 10113;
	const INVALID_PACKET_NUM		= 10114;
	const INVALID_PACKET			= 10115;
	const PACKET_NOTHING_LEFT		= 10116;
	const PACKET_ALREADY_GRABBED	= 10117;
	const REPEAT_MARK_LESSON		= 10118;
	const GUIDANCE_NOT_NEED_BUY		= 10119;
	const OSS_ERROR                 = 11000;
	const INSERT_BAD                 = 11001;
	const INVALID_STAGE_ID			=11002;
	const GRANT_MEMBER_FAILED		= 11003;
	static $arrErrorMessage = array(
			self::SYSTEM_ERROR						=> '系统错误',
			self::DATABASE_ERROR					=> '数据库错误',

			self::ILLEGALL_URI						=> '非法URI',
			self::INVALID_TOKEN						=> '账号在其他地方登录，请重新登录！',
			self::SHORT_OF_MOBILE					=> '缺少mobile字段',
			self::INVALID_MOBILE					=> '无效的手机号码',
			self::REQUEST_TOO_OFTEN 			=> '请求过于频繁，请稍后再试',
			self::GET_VERIFY_CODE_FAILED	=> '获取验证码失败，请重新获取',
			self::INVALID_VERIFY_CODE			=> '验证码不正确，请重新填写',
			self::EXPIERD_VERIFY_CODE			=> '验证码已经过期，请重新获取',
			self::EMPTY_POST_DATA					=> 'Post数据为空',
			self::DATA_DECODE_FAILED			=> 'Post数据解析失败',
			self::SHORT_OF_UTYPE					=> '缺少utype字段',
			self::INVALID_UTYPE						=> '非法的utype',
			self::SHORT_OF_VERIFY_CODE		=> '缺少verifycode字段',
			self::ILLEGAL_VERIFY_CODE			=> '非法的验证码',
			self::SHORT_OF_PASSWORD				=> '缺少password字段',
			self::ILLEGAL_PASSWORD				=> '非法的密码',
			self::PASSWORD_TOO_SHORT			=> '密码长度小于6位',
			self::PASSWORD_TOO_LONG				=> '密码长度大于15位',
			self::MOBILE_EXISTS						=> '手机号码已注册',
			self::ALLOC_USER_ID_FAILED		=> '分配用户ID失败',
			self::REGISTER_FAILED					=> '注册失败',
			self::INSERT_TABLE_FAILED			=> '插入数据表失败',
			self::UPDATE_TABLE_FAILED			=> '更新数据表失败',
			self::MOBILE_NOT_EXIST				=> '手机用户不存在',
			self::PASSWORD_NOT_CORRECT		=> '密码不正确',
			self::SHORT_OF_TOKEN					=> '缺少token字段',
			self::REQUIRED_FIELD_EMPTY		=> '必填字段为空',
			self::INCORRECT_FIELD_FORMAT	=> '字段格式不正确',
			self::USER_NOT_EXIST					=> '用户不存在',
			self::RESET_PASSWORD_FAILED		=> '重置密码失败',
			self::LOGIN_FAILED						=> '登录失败',
			self::LOGOUT_FAILED						=> '退出登录失败',
			self::MODIFY_PROFILE_FAILED		=> '修改资料失败',
			self::CHANGE_PASSWORD_FAILED	=> '修改密码失败',
			self::SHORT_OF_ADVERTISEMENT_ID	=> '缺少advertisement_id字段',
			self::SHORT_OF_PARAMETER			=> '缺少参数',
			self::COURSE_NOT_EXIST				=> '课程不存在',
			self::SHORT_OF_VIDEO_ID				=> '缺少video_id字段',
			self::ILLEGAL_VIDEO_ID				=> '非法的视频ID',
			self::VIDEO_NOT_EXIST					=> '视频不存在',
			self::SELECT_TABLE_FAILED			=> '查询数据库失败',
			self::SHORT_OF_MARK						=> '缺少mark字段',
			self::INVALID_MARK						=> '无效的mark值',
			self::SHORT_OF_COURSE_ID			=> '缺少course_id字段',
			self::ILLEGAL_COURSE_ID				=> '非法的课程ID',
			self::SHORT_OF_EXPERT_ID			=> '缺少expert_id字段',
			self::ILLEGAL_EXPERT_ID				=> '非法的expert_id',
			self::EXPERT_NOT_EXIST				=> '专家不存在',
			self::SHORT_OF_TEST_ID				=> '缺少test_id字段',
			self::ILLEGAL_TEST_ID					=> '非法的测验ID',
			self::TEST_NOT_EXIST					=> '测验不存在',
			self::SHORT_OF_RIGHT_NUM			=> '缺少right_num字段',
			self::ILLEGAL_RIGHT_NUM				=> '非法的right_num值',
			self::SHORT_OF_ANSWERS				=> '缺少answers字段',
			self::ILLEGAL_ANSWERS					=> '非法的answers值',
			self::IVLALID_TIME_FORMAT			=> '时间格式不正确',
			self::SHORT_OF_MESSAGE				=> '缺少message字段',
			self::EMPTY_MESSAGE						=> '消息内容为空',
			self::SHORT_OF_TO_UID					=> '缺少to_uid字段',
			self::INVALID_USER_ID					=> '无效的user_id',
			self::SEND_MESSAGE_FAILED			=> '发送消息失败',
			self::INVALID_MTYPE						=> '非法的mtype',
			self::SHORT_OF_MESSAGE_ID			=> '缺少message_id',
			self::SHORT_OF_NOTICE_ID			=> '缺少notice_id',
			self::INVALID_NOTICE_ID				=> '无效的notice_id',
			self::INVALID_STAGE_ID				=> '无效的阶段',
			self::SHORT_OF_LIVE_COURSE_ID	=> '缺少live_course_id',
			self::SHORT_OF_PORTRAIT_DATA	=> '缺少头像数据',
	    
	        self::LIVE_COURSE_NOT_EXIST		=> '直播课不存在',
			self::INVALID_REG_CODE              => '无效的注册码',
            self::GRANT_CONPONS_FAILED          => '发放课时票失败',
            self::NO_REG_CODE                   => '用户无注册码',
            self::INVALID_MONEY                 => '无效金额',
            self::INVALID_PAY_CHANNEL           => '无效支付通道',
            self::CLOSE_PAY_CHANNEL             => '支付通道暂不可用',
            self::CHARGE_ORDER_FAILED           => '提交充值订单失败',

            self::INVALID_ORDER_NO              => '无效订单号',
	        self::ERROR_ORDER_STATUS            => '订单状态有误',
            self::CANCEL_ORDER_FAILED           => '取消订单失败',
            self::INVALID_LIVE_COURSE_ID        => '无效直播课ID',
            self::LIVE_COURSE_ORDER_FAILED      => '提交购课订单失败',
            self::INVALID_PAY_TYPE              => '无效支付方式',
            self::INVALID_PAY_BALANCE           => '无效支付金额',
            self::INVALID_COUPON_ID             => '无效课时票',
            self::LESS_BALANCE                  => '余额不足',
            self::INVALID_BUSINESS_TYPE         => '无效业务类型',
            self::INVALID_ORDER                 => '无效订单',
            self::ALIPAY_SIGN_FAILED            => '支付宝签名失败',
	        self::ALIPAY_VERIFY_NOTIFY_SIGN_FAILED =>'支付宝验签失败',
	        self::SHORT_OF_SUBJECT              => '请选择科目',
	    
	        self::WXPAY_SIGN_FAILED             => '微信签名失败',
	        self::WXPAY_REQUEST_FAILED          => '请求微信支付失败',
            self::WXPAY_VETIFY_SIGN_FAILED      => '微信签名验证失败',
	        self::WXPAY_NOTIFY_SHORT_PARA       => '微信支付通知缺少参数',
	        self::WXPAY_NOTIFY_FAILD            => '微信支付通知失败',
	        self::WXPAY_FAILED                  => '微信支付失败',
	        self::ALIPAY_FAILED                 => '支付宝支付失败',
	        self::COURSE_BUYED                  => '您已购买了此课程，请前往我的课堂查看您的课程',
	        self::COURSE_ORDER_CREATED          => '您已报名了此课程，请前往我的订单完成支付',
	        self::COURSE_ENDED                  => '课程已结束',
	        self::GET_COURSES_FAILED            => '课程获取失败',	
	        self::COURSE_EMPTY                  => '没有更多课程了',
	        self::SHORT_OF_CATALOG_ID           => '缺少分类ID',
	        self::NO_LESSONS                    => '没有课堂',
	        self::SHORT_OF_EXPERT_TYPE          => '缺少专家类型', 
	        self::INVALID_LESSON_ID             => '无效课程ID',
	        self::SHORT_OF_STAGE_TYPE           => '无效阶段类型',
			self::SHORT_OF_STAGE         		 => '缺少阶段类型ID',
	        self::SHORT_OF_SUBJECT_ID           => '无效学科ID',
	        self::SHORT_OF_CCVID                => '无效CCVID',
	        self::INVALID_PARTNER_ID            => '无效合作伙伴',
			self::CHARGE_ORDER_NOT_EXIT			=> '订单暂无',
			self::MOVE_COURSE_LOSE              =>'删除课程失败',
		    self::INVALID_BIRTH					=> '生日不能大于当前日期',
		    self::MARK_LESSON_FAILED			=>'请先购买课程',
		    self::INVALID_PACKET_NUM			=>'红包数量不合法',
		    self::INVALID_PACKET 				=>'红包不存在',
		    self::PACKET_NOTHING_LEFT			=>'红包已抢完',
		    self::PACKET_ALREADY_GRABBED		=>'已抢过该红包',
		    self::REPEAT_MARK_LESSON			=>'请不要重复评分',
		    self::GUIDANCE_NOT_NEED_BUY			=>'课程导学，无需购买！',

			self::OSS_ERROR                     =>'阿里云接口调用错误',
			self::INSERT_BAD                     =>'数据插入失败',
			self::GRANT_MEMBER_FAILED			=>'生成会员失败',
	);

	static function errorMessage($errorCode)
	{
		if(isset(self::$arrErrorMessage[$errorCode])) {
			return self::$arrErrorMessage[$errorCode];
		} else {
			return "未知错误码";
		}
	}
}

?>
